package au.com.iglootech.TaxTimeToolTip.component;

import au.com.iglootech.TaxTimeToolTip.util.InvoiceUtil;
import au.com.iglootech.component.IGTTable;

import com.vaadin.data.Container;
import com.vaadin.data.Property;

public class InvoiceTable extends IGTTable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -6360217263614630402L;
	public InvoiceTable()
	{
		super();
	}
	
	public InvoiceTable(String caption)
	{
		super(caption);
	}
	
	public InvoiceTable(String caption, Container dataSource)
	{
		super(caption, dataSource);
	}
	@Override
	protected String formatPropertyValue(Object rowId, Object colId,
			Property property) {
		// Format by property type
		if ("invoiceNumber".equals(colId)) {
			return InvoiceUtil.formatInvoiceNumber((Integer) property.getValue());
		} 

		return super.formatPropertyValue(rowId, colId, property);
	}
}
